{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>志愿者认证</h5>
                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <i class="fa fa-chevron-up"></i>
                        </a>
                    </div>
                </div>
                <div class="ibox-content">
                    <form class="form-horizontal" name="userAdd" id="userAdd" >
                        <input type="hidden" name="mechanism_id" value="{$info.mechanism_id}">
                        <input type="hidden" name="user_id" value="{$info.user_id}">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">姓名：</label>
                            <div class="input-group col-sm-4">
                                <input id="user_rel_name" type="text" class="form-control" name="user_rel_name" value="{$info.user_rel_name}" disabled>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">身份证号：</label>
                            <div class="input-group col-sm-4">
                                <input id="user_card" type="text" class="form-control" name="user_card" value="{$info.user_card}" disabled>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label yanse">所属机构：</label>
                            <div class="input-group col-sm-4">
                                <input id="mechanism_name" type="text" class="form-control" name="mechanism_name" value="{$info.mechanism_name}" disabled>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label yanse">所在地区：</label>
                            <div class="input-group col-sm-4">
                                <input id="district" type="text" class="form-control" name="district" value="{$info.district}" disabled>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label yanse">执业医院：</label>
                            <div class="input-group col-sm-4">
                                <input id="user_hospital" type="text" class="form-control" name="user_hospital" value="{$info.user_hospital}" disabled>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label yanse">所属科室：</label>
                            <div class="input-group col-sm-4">
                                <input id="user_department" type="text" class="form-control" name="user_department" value="{$info.user_department}" disabled>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label yanse">职称：</label>
                            <div class="input-group col-sm-4">
                                <input id="user_title" type="text" class="form-control" name="user_title" value="{$info.user_title}" disabled>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label yanse">职务：</label>
                            <div class="input-group col-sm-4">
                                <input id="user_post" type="text" class="form-control" name="user_post" value="{$info.user_post}" disabled>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">证明图片：</label>
                            {if(!empty($info.user_business_image.0))}
                            <div class="input-group col-sm-4">
                                {volist name='info.user_business_image' id='vo'}
                                <img id="user_identity_image" class="img-circle" height="80px" width="80px" style="float:left;margin-left: 50px;margin-top: 5px;cursor:pointer;" src="{$vo}" onclick='imgDisplay(this)'/>
                                {/volist}
                            </div>
                            {else /}
                            暂无图片
                            {/if}
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">审核结果：</label>
                            <div class="layui-input-block">
                                <label><input type="radio" name="user_attestation" value="3" id="allow" checked>通过&nbsp;</label>
                                <label><input type="radio" name="user_attestation" value="4" id="reject" >驳回</label>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">驳回理由：</label>
                            <div class="layui-input-block">
                                <textarea name="user_false_reason" id="reason" cols="30" rows="10" disabled></textarea>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-3">
                                <button class="btn btn-primary btsave" type="submit" id="shen"><i class="fa fa-save"></i> 审核</button>
                                <a class="btn btn-danger" href="javascript:history.go(-1);"><i class="fa fa-close"></i> 返回</a>
                            </div>
                        </div>
                    </form>
                </div>
            </div>

        </div>
    </div>
</div>
{include file="public/footer" /}
<script type="text/javascript" src="__JS__/Crop.js"></script>
<script type="text/javascript">
    $().ready(function() {
        var e = "<i class='fa fa-times-circle'></i> ";
        $("#userAdd").validate({
            submitHandler: function(form) {
//                $('button').attr('disabled', 'disabled');
                $.ajax({
                    url: "{:url('Uuser/uUserAttestation')}",
                    type: "post",
                    dataType: "json",
                    data: $("#userAdd").serialize(),
                    success: function (data) {
                        if (data.code == 200) {
                            wk.success(data.msg,1,"{:url('Uuser/index')}");
                        } else {
                            $('button').removeAttr('disabled');
                            wk.error(data.msg,2,'');
                            return false;
                        }
                    }
                });
            },
        })
    });

    //审核成功、驳回
    $(document).on('click', '#allow', function(){
        $('#reason').attr('disabled',true);
        $("#reason").trigger("chosen:updated");
    })
    $(document).on('click', '#reject', function(){
        $('#reason').attr('disabled',false);
        $("#reason").trigger("chosen:updated");
    })

</script>
</body>
</html>